import numpy as np
import matplotlib.pyplot as plt

class BaseShow:
    def __init__(self):
        self.path = "."

    def show_sin(self, start, length, step):
        x = np.arange(start, length, step)
        y = np.sin(x)

        plt.plot(x, y)
        plt.show()

    def show_cos(self, start, length, step):
        x = np.arange(start, length, step)
        y = np.cos(x)

        plt.plot(x, y)
        plt.show()

    def show_fft(self, start, length, count):
        x = np.linspace(start, length, count)
        y = np.cos(x)
        transformed = np.fft.fft(y)
        plt.plot(transformed)
        plt.show()

class BaseShowSimple(BaseShow):
    def __init__(self):
        super(BaseShowSimple, self).__init__()

    def show_sin_simple(self):
        self.show_sin(-2*np.pi, 2*np.pi, 0.01)

    def show_cos_simple(self):
        self.show_cos(-2*np.pi, 2 * np.pi, 0.01)

    def show_fft_simple(self):
        self.show_fft(-2*np.pi, 2*np.pi, 30)
